﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace H.Nets
{
    /// <summary>
    /// 表示一个网络对象工厂
    /// </summary>
    public interface INetFactory : IFactory
    {
        /// <summary>
        /// 创建一个Tcp服务端
        /// </summary>
        /// <param name="port">服务端监听的端口</param>
        /// <returns>返回一个服务端对象</returns>
        ITcpServer CreateTcpServerInstance(int port);

        /// <summary>
        /// 创建一个Tcp客户端(用于连接服务端)
        /// </summary>
        /// <param name="hostName">服务端的IP地址或域名</param>
        /// <param name="port">服务端的端口</param>
        /// <returns>返回一个客户端对象</returns>
        ITcpClient CreateTcpClientInstance(string hostName, int port);
    }
}
